<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 700px;
            margin: 0 auto;
        }

        ul li {
            list-style: none;
            float: left;
            width: 100px;
            text-align: center;
            background-color: pink;
            border: solid 1px black;
        }
        ol{  
            background-color: green;
            position: relative;
        }
        ol li {
            list-style: none;
            text-align: center;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin:  20% auto;
            font-size: 20px;
            display: none;
        }
        .show{
            display: block;
        }
        .active {
            background-color: skyblue;
        }
    </style>
</head>

<body>
    <div>
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
            <li>6</li>
        </ul>
        <ol>
            <li>11</li>
            <li>22</li>
            <li>33</li>
            <li>44</li>
            <li>55</li>
            <li>66</li>
        </ol>
    </div>
   
    <script>
        let lis = document.querySelectorAll('div>ul>li')
        let oils=document.querySelectorAll('ol li')
        console.log(oils)
        function changge() {
            for (let i = 0; i < lis.length; i++) {
                lis[i].onclick = function () {

                    for (let j = 0; j < lis.length; j++) {
                        lis[j].classList.remove('active')
                        oils[j].classList.remove('show')
                     }
                    lis[i].classList.add('active')
                    oils[i].classList.add('show')
                }
            }
        }
        changge()
        // function changge2(){
        //     for (let i = 0; i < lis.length; i++) {
        //         lis[i].onclick = function () {
        //             for (let j = 0; j < lis.length; j++) {
        //                //lis[j].setAttribute('class','')
        //                 lis[j].removeAttribute('class')
        //              }
        //             lis[i].setAttribute('class','active')
        //         }
        //     }

        // }
        // changge2()
    </script>
</body>

</html>